#include<iostream>
using namespace std;
const int N = 1e5 + 10;
int n, k;
int f[N];
int main()
{
	cin >> n >> k;
	f[0] = 1;
	for (int i = 1;i <= n;i++)
	{
		//直接让现在的值加上i-k个的结果
		for (int j = i-1;j >= i - k && j >= 0;j--)
		{
			f[i] = (f[i] + f[j]) % 100003;
		}
	}
	cout << f[n] << endl;
	return 0;
}